/*
* @author Cole Gehlen
*/
package com.apps.test;
import static org.junit.Assert.*;
import java.util.List;
import org.junit.Test;
import com.apps.datastore.dao.BookInformation;
import com.apps.services.SaveonbookService;
import com.apps.services.factory.SaveonBookServiceFactory;
import com.apps.ubc.cc.model.SaveonBookModel;
public class SaveonbookSearchServiceTest {
@Test
public void test() {
SaveonbookService sss = SaveonBookServiceFactory.getSaveonbookService();
BookInformation testbi = new BookInformation("Discrete Mathematics W/Applications 4/E", "Required", "EPP", "9780495391326");
List<SaveonBookModel> sbml1 = sss.search(testbi);
List<SaveonBookModel> sbml2 = sss.titleSearch("Discrete Mathematics with Applications");
assertTrue(sbml2.get(0).getCourse().equals(">CPSC121"));
assertTrue(sss.getOptimizedTitle(testbi).equals("Discrete Mathematics with Applications"));
assertTrue(sss.getPriceRange(sbml1)[0] == 49 && sss.getPriceRange(sbml1)[1] == 180);
}
}